<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    
    var jsonStr='{"name":"张三","age":12,"gender":"男"}'//键必须用双引号；且最后一个数据是不加逗号的
    var obj=JSON.parse(jsonStr)
    console.log(obj);

    var o={
        name:'李四',
        age:14,
        gender:'女',
        eat(){
            console.log(2);
        }
    }
    console.log(o);
    console.log(JSON.stringify(o));//会自动把函数类型的数据给过滤掉

    var oo=JSON.parse(JSON.stringify(o))
    oo.name='王五'
    console.log(oo);


    var d={
        hello:"sds",
        撒旦撒:""
    }
    var flag=true
 function fn(){
    for(let key in d ){
        console.log(key.length);
        if(key.length>3){
            console.log("sds");
            flag=false
        }
        console.log(3333);
    }
   }
   fn()
 
 if(flag==false){
    break
 }
 console.log(444);  
</script>
</html>